package com.xydzxt.www.controller.student;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
public class MsgController {

    @GetMapping("/msg")
    public String msg(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String msg=req.getParameter("msg");

        if (msg!=null && !msg.equals("")){

            req.setAttribute("msg",msg);
            return "student/msg.html";
        }else {
            resp.sendRedirect("index");
        }
        return "";
    }
}
